package cn.cdeden.common.translation.core.impl;

import cn.cdeden.common.translation.annotation.TranslationType;
import cn.cdeden.common.translation.constant.TransConstant;
import cn.cdeden.common.translation.core.TranslationInterface;
import cn.cdeden.resource.api.RemoteFileService;
import lombok.AllArgsConstructor;
import org.apache.dubbo.config.annotation.DubboReference;


/**
 * OSS翻译实现
 *
 * @author Yu.
 * @Date 2025/2/7 14:51
 **/
@AllArgsConstructor
@TranslationType(type = TransConstant.OSS_ID_TO_COVER_URL)
public class OssCoverUrlTranslationImpl implements TranslationInterface<String> {

    @DubboReference(mock = "true")
    private RemoteFileService remoteFileService;

    @Override
    public String translation(Object key, String other) {
        return remoteFileService.selectImageUrlByIds(key.toString());
    }
}
